import java.util.ArrayList;
import java.util.List;

/**
 * 成绩管理类，处理成绩相关的业务逻辑
 */
public class GradeManager {
    private List<Grade> grades;

    public GradeManager() {
        grades = DataPersistence.loadGrades();
        if (grades == null) {
            grades = new ArrayList<>();
        }
    }

    public void addGrade(Grade grade) {
        grades.add(grade);
        DataPersistence.saveGrades(grades);
    }

    public List<Grade> getAllGrades() {
        return grades;
    }
}    